<?php
	# If a user is signed in, go to microorganisms page
	if(isset($_COOKIE['acct']['id']) and isset($_COOKIE['acct']['email'])) {
		header('refresh: 0.1; url="http://localhost/microwebph/main.php?micro=view"'); return;
	}
?>

<!DOCTYPE HTML>

<html xmlns="http://www.w3.org/1999/xhtml">

<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<title>MicroWebPH</title>
	
	<link href="style/jquery-ui-1.8.18.custom.css" type="text/css" rel="stylesheet"/>
	<script src="script/jquery-1.7.1.min.js" type="text/javascript"></script>
	<script src="script/jquery-ui-1.8.18.custom.min.js" type="text/javascript"></script>
	
	<link href="style/mystyle.css" type="text/css" rel="stylesheet"/>
	<script src="script/jquery.livequery.js" type="text/javascript"></script>
	<script src="script/functions.js" type="text/javascript"></script>
	<script src="script/myscript.js" type="text/javascript"></script>
</head>

<body>
	<div id="cloak">
		<img src="template/loading.gif" class="loading-gif" alt="Loading..."/>
		<div class="time"></div>
		<div class="elapsed"></div>
	</div>
	<div id="coat"></div>
	<div id="mask"></div>
	
	<div id="head">
		<div id="top"></div>
		<a href="/microwebph">
			<div id="nav-active" class="index home-logo" data-tool="{'head':'<span class=\'cool\'>An Online Repository, Management and Retrieval System for Information on Microorganisms</span>','x':'l'}">MicroWebPH</div>
		</a>
		<div id="signup">Not registered? <a data-modal="#mod-signup" class="bold">Sign up.</a></div>
	</div>
	
	<div id="main">
		<div class="sign">
			<!-- Search form -->
			<form id="form-search-index">
				<input type="search" placeholder="Search microorganism" class="reqd" data-guess="micro=guess"/>
				<input name="q" type="hidden" class="abled"/>
				<button type="submit" class="search">Search</button>
			</form>
			
			<!-- Sign in form -->
			<form id="form-signin" class="form-signin right" method="post" action="sign.php?in">
				<input name="emailIn" type="email" placeholder="Email" class="reqd" data-tool="{'head':'Email','x':'l'}"/>
				<input name="pwordIn" type="password" placeholder="Password" class="reqd" data-tool="{'head':'Password','x':'l'}"/>
				<button type="submit">Sign in</button>
			</form>
		</div>
		
		<!-- Theatre -->
		<div id="theatre" class="mark area">
			<div class="modal-head locked">
				<div id="search-results">
					<button id="sr-current" type="button"></button>
					<div id="sr-container" class="modal area">
						<div class="modal-head"><b>Search results</b> <button type="button" class="modal-reject"></button></div>
						<div class="modal-body"></div>
					</div>
					<div id="sr-current-item"></div>
				</div>
				<button type="button" class="img-home home none" title="Back to original image">Home</button>
			</div> <?php
				# Set up stage
				require_once "process.php";
			?>
			<div class="tiles"></div>
		</div>
	</div>
	
	<div id="modals"></div>
</body>

</html>
